package day4;
import day2.People;

import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class CollectionsTest {
    public static void main(String[] args) {
        //Collections 操作 List
        List<Integer>  list=new ArrayList<>();
        list.add(23);
        list.add(15);
        list.add(13);
        list.add(17);
        list.add(127);
        list.add(14);
        Integer i = Collections.max(list);
        System.out.println(i);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>");
        List<People> l2=new ArrayList<>();
        l2.add(new People("小吴","男",22));
        l2.add(new People("小张","男",21));
        l2.add(new People("老宋","男",32));
        l2.add(new People("老马","女",52));
        l2.add(new People("Tomas","女",33));
        People max = Collections.max(l2);
        People min = Collections.min(l2);
        System.out.println("最大："+max);
        System.out.println("最小："+min);
        Collections.sort(l2);
        System.out.println("排序后：》》》》》》》》》》》》》》》");
        for(People p:l2)
            System.out.println(p);
    }
}
